package cn.community.system.service.impl;

import cn.community.system.mapper.AdminReportMapper;
import cn.community.system.query.AdminDeviceReportQuery;
import cn.community.system.query.AdminReportQuery;
import cn.community.system.query.QueryObject;
import cn.community.system.service.IAdminReportService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AdminReportServiceImpl implements IAdminReportService{

    @Autowired
    private AdminReportMapper adminReportMapper;

    @Override
    public PageInfo selectAllActivityReport(AdminReportQuery qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<Map> list = adminReportMapper.selectAllActivityReport(qo);
        return new PageInfo(list);
    }

    @Override
    public List<Map> listAll(QueryObject qo) {
        return adminReportMapper.selectAllActivityReport(qo);
    }

    @Override
    public PageInfo selectAllDeviceReport(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<Map> list = adminReportMapper.selectAllDeviceReport(qo);
        return new PageInfo(list);
    }

    @Override
    public List<Map> listDeviceAll(QueryObject qo) {
        return adminReportMapper.selectAllDeviceReport(qo);
    }

    @Override
    public PageInfo selectReturnDeviceReport(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<Map> list = adminReportMapper.selectReturnDeviceReport(qo);
        return new PageInfo(list);
    }

    @Override
    public List<Map> listDeviceReturn(AdminDeviceReportQuery qo) {
        return adminReportMapper.selectReturnDeviceReport(qo);
    }

}
